package cn.kongwg.dao.impl;

import cn.kongwg.bean.OrderItem;
import cn.kongwg.dao.BaseDao;
import cn.kongwg.dao.OrderItemDao;

/**
 * @author kongwg
 * @create 2021-02-01 11:26
 */
public class OrderItemDaoImpl extends BaseDao implements OrderItemDao {

    @Override
    public Integer saveOrderItem(OrderItem orderItem) {
        String sql = "insert into t_order_item(`name`,`count`,`price`,`total_price`,`order_id`) values(?,?,?,?,?)";

        return update(sql, orderItem.getName(), orderItem.getCount(), orderItem.getPrice(), orderItem.getTotalPrice(), orderItem.getOrderId());
    }
}
